package com.bdqn.service;

import com.bdqn.mapper.SysUserMapper;
import com.bdqn.pojo.Supplier;
import com.bdqn.pojo.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Scope("prototype")
@Service("SysUserService")
public class SysUserServiceImpl implements SysUserService{
    @Autowired
    private SysUserMapper sysUserMapper;
    @Override
    public List<Supplier> list(Supplier supplier) {
        try{
            return sysUserMapper.list(supplier);
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
    }

    public SysUserServiceImpl() {
    }

    public SysUserServiceImpl(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }

    @Override
    public boolean add(SysUser sysUser) {
        return false;
    }

//    @Override
//    public boolean add(SysUser sysUser) {
//        boolean result = false;
//
//        try{
//            if (service.addAll(sysUser) == 1){
//                result = true;
//            }
//        }catch (RuntimeException e){
//            e.printStackTrace();
//            throw e;
//        }
//        return result;
//    }


}
